import Vue from "vue";
import VueRouter from "vue-router";
import Index from "../views/Index.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: '/index/newgame'
  },
  {
    path: "/index",
    name: "home",
    component: Index,
    redirect: '/index/newgame',
    children: [
      {
        path: "newgame",
        name: '/index/newgame',
        component: () => import("../views/index/NewGame.vue"),
      },
      {
        path: "adgame",
        name: '/index/adgame',
        component: () => import("../views/index/AdGame.vue"),
      },
      {
        path: "iosgame",
        name: '/index/iosgame',
        component: () => import("../views/index/IosGame.vue"),
      },
    ]
  },
  {
    path: "/newgame",
    name: "newgame",
    component: () => import("../views/newGame.vue"),
  },
  {
    path: '/giftbag',
    name: 'giftbag',
    component: () => import('../views/giftBag.vue'),
  },
  {
    path: "/hot",
    name: "hot",
    component: () => import("../views/indexhot.vue"),
  },

  {
    path: '/gamecenter',
    name:'gamecenter',
    component: () => import('../views/GameCenter.vue'),
  },
  {
    path: "/gamedetail",
    name: "gamedetail",
    component: () => import("../views/GameDetail.vue"),
  },

  //搜索页面
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/search.vue'),
  },


  // 资讯页面
  {
    path: '/information',
    component: () => import('../views/Information.vue')
  },
  {
    path: '/customer',
    name: 'customer',
    component: () => import('../views/Customer.vue'),
  },

]

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
